package com.carousel.test;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    CarouselLayout mCarouselLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.content_main);

        mCarouselLayout = (CarouselLayout) findViewById(R.id.cl_layout);

        List<CarouselItem> mItems = new ArrayList<>();
        mItems.add(new CarouselItem(0, R.mipmap.ic_launcher));
        mItems.add(new CarouselItem(1, R.mipmap.ic_launcher));
        mItems.add(new CarouselItem(2, R.mipmap.ic_launcher));

        mCarouselLayout.setCarouselItems(mItems);
        mCarouselLayout.setRadius(1.0f);
        mCarouselLayout.setAutoScroll(true, 3000);

        mCarouselLayout.setOnItemClickListener(new CarouselLayout.OnItemClickListener() {
            @Override
            public void onItemClick(View view, int tag) {
                Log.e("TAG", "tag : " + tag);
            }
        });
    }

}
